define([], function() {
    'use strict';

    var Item = (function () {
        function Item(type, name, price) {
            // 'accessory', 'smart-phone', 'notebook', 'pc' or 'tablet'
            if (type !== 'accessory' && type !== 'smart-phone' &
                type !== 'notebook' & type !== 'pc' & type !== 'tablet') {
                throw Error('You can declare only items with valid type');
            }
            
            if (name.length < 6 || name.length > 40) {
                throw Error('You can declare items with name length longer than 5 and shorter than 41 symbols');
            }

            if (typeof parseFloat(price) !== 'number') {
                throw Error("Item's price should be a number")
            }

            this._type = type;
            this._name = name;
            this._price = parseFloat(price);
        }

        return Item;
    }());

    return Item;
});